package com.jietuo.class02;

public class Node {
    int value;
    Node next;

    public Node(int value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                ", next=" + next +
                '}';
    }

    public static void printNode(Node node) {
        while (node.next != null) {
            System.out.println(node.toString());
            node = node.next;
        }
    }
}